from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from aiogram.utils.keyboard import InlineKeyboardBuilder
from aiogram.filters.callback_data import CallbackData


class Paginattion(CallbackData, prefix="pag"):
    action: str
    page: int
    
    
def pagination(page: int=0):
    bulder = InlineKeyboardBuilder()
    bulder.row(
        InlineKeyboardButton(text="<-", callback_data=Paginattion(action="prev", page=page).page()),
        InlineKeyboardButton(text="->", callback_data=Paginattion(action="next", page=page).page()),
        width=2
    )
    return bulder.as_markup()